
minetest.register_craft({
	--type = "shapeless", --Esta dando bug e nao sei porque
	output = "farming:flour",
	recipe = {
		{"farming:wheat"},
		{"farming:wheat"},
	}
})

--##############################################################################################################

minetest.register_craftitem("lunorecipes:wheat_flour_bag", {
	description = "Bolsa de Farinha de Trigo",
	inventory_image = "obj_bag_wheat_flour.png",
	groups = { eat=1 },
	--stack_max=16, --Acumula 16 por slot
})

minetest.register_craft({
	output = "lunorecipes:wheat_flour_bag",
	recipe = {
		{"farming:flour"	, "farming:flour"	, "farming:flour"},
		{"farming:flour"	, "farming:flour"	, "farming:flour"},
		{"farming:flour"	, "farming:flour"	, "farming:flour"},
	},
})

minetest.register_craft({
	output = "farming:flour 9",
	recipe = {
		{"lunorecipes:wheat_flour_bag"},
	},
})


--##############################################################################################################

minetest.register_craftitem("lunorecipes:wheat_seed_bag", {
	description = "Bolsa de Sementes de Trigo",
	inventory_image = "obj_bag_wheat_seed.png",
	groups = { eat=1 },
	--stack_max=16, --Acumula 16 por slot
})

minetest.register_craft({
	output = "lunorecipes:wheat_seed_bag",
	recipe = {
		{"farming:seed_wheat"	, "farming:seed_wheat"	, "farming:seed_wheat"},
		{"farming:seed_wheat"	, "farming:seed_wheat"	, "farming:seed_wheat"},
		{"farming:seed_wheat"	, "farming:seed_wheat"	, "farming:seed_wheat"},
	},
})

minetest.register_craft({
	output = "farming:seed_wheat 9",
	recipe = {
		{"lunorecipes:wheat_seed_bag"},
	},
})

--##############################################################################################################

minetest.register_node("lunorecipes:wheatofbale", {
	description = "Fardo de Trigo",
	--drawtype = "nodebox",
	--paramtype = "light", --Não sei pq, mas o bloco não aceita a luz se nao tiver esta propriedade
	--paramtype2 = "facedir",
	--light_source = LIGHT_MAX, --Este tapete brilha no escuro pq é mágico.
	node_box = {
		type = "fixed",
		fixed = { {-.5,-.5,-.5,    .5,.5,.5}	}
	},
	selection_box = {
		type = "fixed",
		fixed = { {-.5,-.5,-.5,    .5,.5,.5}	}
	},
	tiles = {
		"tex_wheatofbale_topdown.png", --acima
		"tex_wheatofbale_topdown.png^[transformfx",  --abaixo
		"tex_wheatofbale_size.png" --lados
	},
	groups = {snappy=3,flammable=2,dig_immediate=3,attached_node=1},
	--sounds = default.node_sound_wood_defaults(),
	--sounds = default.node_sound_dirt_defaults(),
	sounds = default.node_sound_dirt_defaults({
		footstep = {name="default_grass_footstep", gain=0.25},
	}),
	--drop = "farming:wheat 9",
	after_place_node = function(pos, placer)
		local meta = minetest.get_meta(pos)
		meta:set_string("infotext", "Fardo de Trigo")
	end,
})

minetest.register_craft({
	output = "lunorecipes:wheatofbale",
	recipe = {
		{"farming:wheat", "farming:wheat", "farming:wheat"},
		{"farming:wheat", "farming:wheat", "farming:wheat"},
		{"farming:wheat", "farming:wheat", "farming:wheat"},
	}
})

minetest.register_craft({
	output = "farming:wheat 9",
	recipe = {
		{"lunorecipes:wheatofbale"},
	}
})


minetest.register_alias("wheatofbale"		,"lunorecipes:wheatofbale")
minetest.register_alias("fardodetrigo"		,"lunorecipes:wheatofbale")
minetest.register_alias("fardotrigo"		,"lunorecipes:wheatofbale")
minetest.register_alias("blocodetrigo"		,"lunorecipes:wheatofbale")
minetest.register_alias("blocotrigo"		,"lunorecipes:wheatofbale")
